Language

An opaque object that defines how to parse a particular language. The code for each Language is gen by the Tree-sitter CLI.

Constructors

this
this(TSLanguage* tslanguage)

create a new Language.

Members

Functions

field_count
auto field_count()

Get the number of distinct field names in this language.

field_id_for_name
auto field_id_for_name(string field_name)

Get the numerical id for the given field name.

field_name_for_id
auto field_name_for_id(ushort field_id)

Get the field names for the given numerical id.

get_version
auto get_version()

Get the ABI version number that indicates which version of the Tree-sitter CLI that was used to generate this Language.

id_for_node_kind
auto id_for_node_kind(string kind, bool named)

Get the numeric id for the given node kind.

node_kind_count
auto node_kind_count()

Get the number of distinct node types in language.

node_kind_for_id
auto node_kind_for_id(ushort id)

Get the name of the node kind for the given numerical id.

node_kind_is_named
auto node_kind_is_named(ushort id)

Check if the node type for the given numerical id is named (as opposed to an anonymous node type).

node_kind_is_visible
auto node_kind_is_visible(ushort id)

Check if the node type for the given numerical id is anonymous (as opposed to a named node type).

Variables

tslanguage
TSLanguage* tslanguage;

internal TSLanguage

Meta